<link rel="import" href="../../bower_components/polymer/polymer-element.html">

<dom-module id="som-help">
  <template>
    <style>
      ul, p {
        line-height: 160%;
      }
    </style>
    <h2>Sheriff-o-Matic Help</h2>
    <article>
      <p>
        Sheriff-o-Matic (SoM) is a tool designed to help make sheriffing easier. SoM shows alerts for failures and allows you to
        place some basic annotations on them.
      </p>
      <p>
        <strong>To start looking at alerts, click on any of the trees to the left.  </strong>
      </p>

      <p>
        If you encounter any issues with Sheriff-o-Matic, you can file a bug by clicking on the feedback button
        in the bottom right corner of the screen.
      </p>

      <h3>How to Sheriff</h3>
      <p>
        Your main goal as a sheriff is to keep the tree you are sheriffing open
        and green, so that people can submit changes. The alerts on Sheriff-o-Matic
        represent test failures, which can cause problems for the tree.
      </p>
      <p>
        Sheriff-o-Matic provides context surrounding build or test failures, such as ranges
        of relevant commits, to help you determine the cause of a failure.
        As a sheriff, you will often handle failures by reverting culprit patches,
        filing bugs to address root causes, or potentially disabling tests.
      </p>
      <p>
        For more information about sheriffing, see:
        <a href="https://www.chromium.org/developers/tree-sheriffs" target="_blank">https://www.chromium.org/developers/tree-sheriffs</a>
      </p>

      <h3>Alert Actions on Sheriff-o-Matic</h3>
      <p>
        Sheriff-o-Matic supports a variety of different annotation actions for alerts.
        These alert actions are shown on the left side of each alert's body.
        You can also apply annotations to multiple alerts at a time by checking the
        checkboxes next to alert titles.
      </p>
      <ul>
        <li><strong>Examine</strong> failures to see detailed information on related revisions. </li>
        <li><strong>Comment</strong> on alerts to leave notes for other sheriffs to see. </li>
        <li><strong>Snooze</strong> an alert to temporarily move a failure outside of your view. </li>
        <li><strong>Link a Bug</strong> to an alert to keep track of which bug caused the failure.
          <ul>
            <li>Find bugs to link from the <a href="http://crbug.com" target="_blank">Chromium Issue Tracker</a>.</li>
            <li>To link a bug, you can enter the URL or number for the bug. </li>
            <li>If a bug does not yet exist for the failure, you can file a new bug.
              If you do so, remember to go back to Sheriff-o-Matic to link the bug! </li>
          </ul>
        </li>
        <li><strong>Group</strong> related alerts together to simplify your view.
          <ul>
            <li>For grouping, it is recommended that you use the bulk annotation feature
              to easily see data on the alerts you are grouping together. </li>
            <li>Groups are created with autogenerated titles which can be changed. </li>
            <li>Note that groups of alerts have their own sets of annotations. At the moment,
              annotations attached to the alerts in a group are not added to the group.
            </li>
            <li>
              At the moment, you can't group two groups together.
            </li>
          </ul>
        </li>
      </ul>

      <h2>Useful Links</h2>
      <ul>
        <li>
          <a href="https://www.chromium.org/developers/tree-sheriffs" target="_blank">General Sheriffing Introduction</a>
        </li>
        <li>
          <a href="http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium" target="_blank">How to Sheriff the Chromium Tree</a>
        </li>
        <li>
          <a href="https://www.chromium.org/developers/tree-sheriffs/perf-sheriffs" target="_blank">How to Sheriff the Chromium.Perf Tree</a>
        </li>
        <li>
          <a href="https://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium-os" target="_blank">How to Sheriff the Chromium OS Tree</a>
        </li>
        <li>
          <a href="https://g.co/bugatrooper" target="_blank">How to contact a Trooper</a>
        </li>
        <li>
          <a href="https://goto.google.com/findit-manual" target="_blank">How to understand Findit result</a>
        </li>
      </ul>

      <h2>Contributing</h2>
      <p>
        If you'd like to contribute to infrastructure systems, please see the
        <a href="http://goto.google.com/chrome-infra-services">list of services</a>
        with pointers to their source code, configs and owners. If you are planning
        to make any non-trivial changes, please make sure to contact the owners
        before writing any code to check if your idea fits with the overall service
        design. Please also have a look at the
        <a href="https://goto.google.com/chrome-infra-contribute">chrome-infra
        developer documentation<a>.
      </p>
    </article>
  </template>
  <script>
  'use strict';
  class SomHelp extends Polymer.Element {
    static get is() {
      return 'som-help';
    }
  }

  customElements.define(SomHelp.is, SomHelp);
  </script>
</dom-module>
